<HTML>
<head>
    <title>关闭页面出现提示</title>
    <script>
        function closeIt() {
            return "Any string value here forces a dialog box to \n" +
                "appear before closing the window.";
        }

        window.onbeforeunload = closeIt;
    </script>
</head>
<body>
<a href="http://www.microsoft.com">Click here to navigate to
    www.microsoft.com</a>
</body>
</html>